package com.example.demo.mp.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.mp.entity.Announcement;
import com.example.demo.mp.entity.AnnouncementCategory;
import com.example.demo.mp.mapper.AnnouncementCategoryMapper;
import com.example.demo.mp.mapper.AnnouncementMapper;
import com.example.demo.mp.service.AnnouncementCategoryService;
import com.example.demo.mp.service.AnnouncementService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import static java.lang.Thread.sleep;

@Service
public class AnnouncementServiceImpl extends ServiceImpl<AnnouncementMapper, Announcement> implements AnnouncementService {
    @Override
    @Cacheable(value = "announcement:", key = "#id",unless="#result == null")
    public Announcement getAnnouncementById(Long id) {
        return getById(id);
    }
}
